﻿using DTcms.Core.Common.Emum;
using DTcms.Core.Model.Models;
using DTcms.Core.Model.ViewModels;
using System.Linq.Expressions;

namespace DTcms.Core.IServices
{
    /// <summary>
    /// 支付收款接口
    /// </summary>
    public interface IPaymentCollectionService : IBaseService
    {
        /// <summary>
        /// 查询一条记录
        /// </summary>
        Task<PaymentCollection?> QueryAsync(Expression<Func<PaymentCollection, bool>> funcWhere, WriteRoRead writeAndRead = WriteRoRead.Read);

        /// <summary>
        /// 确认收款
        /// </summary>
        Task<bool> ConfirmAsync(string tradeNo, WriteRoRead writeAndRead = WriteRoRead.Write);

        /// <summary>
        /// 取消收款
        /// </summary>
        Task<bool> CancelAsync(Expression<Func<PaymentCollection, bool>> funcWhere, WriteRoRead writeAndRead = WriteRoRead.Write);

        /// <summary>
        /// 根据条件删除记录
        /// </summary>
        Task<bool> DeleteAsync(Expression<Func<PaymentCollection, bool>> funcWhere, WriteRoRead writeAndRead = WriteRoRead.Write);

        /// <summary>
        /// 修改支付方式(客户)
        /// </summary>
        Task<bool> PayAsync(PaymentCollectionEditDto modelDto, WriteRoRead writeAndRead = WriteRoRead.Write);

        /// <summary>
        /// 获取收款总数量
        /// </summary>
        Task<int> QueryCountAsync(Expression<Func<PaymentCollection, bool>> funcWhere, WriteRoRead writeAndRead = WriteRoRead.Read);

        /// <summary>
        /// 获取收款总金额
        /// </summary>
        Task<decimal> QueryAmountAsync(Expression<Func<PaymentCollection, bool>> funcWhere, WriteRoRead writeAndRead = WriteRoRead.Read);
    }
}
